package com.example.demo.controller;

import com.example.demo.config.MqttBroker;
import com.example.demo.entity.PurchaseOrder;
import com.example.demo.util.GetMessage;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.RequiredArgsConstructor;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/api/qrcode")
@RequiredArgsConstructor
@Component
public class QrCodeController {

    @CrossOrigin(origins ="*" ,maxAge = 3600)
    @PostMapping("/make")
    public GetMessage make (String type ,Integer id) throws JsonProcessingException, MqttException {
        if(type.equals("applyOrder")){

        }else if(type.equals("productPlan")){

        }else if(type.equals("materialPlan")){

        }else if(type.equals("tv")){

        }else if(type.equals("lcd")){

        }
        return new GetMessage("失败","500","");
    }
}
